<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>首页 - 光年(Light Year Admin)后台管理系统模板</title>
<link rel="icon" href="../favicon.ico" type="image/ico">
<meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
<meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
<meta name="author" content="yinqi">
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/materialdesignicons.min.css" rel="stylesheet">
<link href="../css/style.min.css" rel="stylesheet">
</head>
  
<body>
<div class="lyear-layout-web">
  <div class="lyear-layout-container">
    <!--左侧导航-->
    <aside class="lyear-layout-sidebar">
      <!-- logo -->
      <div id="logo" class="sidebar-header">
        <a href="../index.html"
          ><img
            src="../images/logo-sidebar.png"
            title="LightYear"
            alt="LightYear"
        /></a>
      </div>
      <div class="lyear-layout-sidebar-scroll">
        <nav class="sidebar-main">
          <ul class="nav nav-drawer">
            
            <li class="nav-item nav-item-has-subnav">
              <a href="javascript:void(0)"
                ><i class="mdi mdi-file-outline"></i> 学生管理</a
              >
              <ul class="nav nav-subnav">
                <li>
                  <a href="../lms-admin/student_table.html">学生列表</a>
                </li>
              </ul>
            </li>
         

           
            <li class="nav-item nav-item-has-subnav">
              <a href="javascript:void(0)"
                ><i class="mdi mdi-file-outline"></i> 班级管理</a
              >
              <ul class="nav nav-subnav">
                <li>
                  <a href="../lms-teacher/create_clazz.html">创建班级</a>
                </li>
                <li>
                  <a href="../lms-admin/clazz_info.html">学习情况</a>
                </li>
              </ul>
            </li>


            <li class="nav-item nav-item-has-subnav">
              <a href="javascript:void(0)"
                ><i class="mdi mdi-file-outline"></i> 作业管理</a
              >
              <ul class="nav nav-subnav">
                <li><a href="../lms-teacher/create_assignment.html">发布作业</a></li>
                <li><a href="../lms-teacher/assignment_list.html">作业列表</a></li>
              </ul>
            </li>
            <li class="nav-item nav-item-has-subnav">
              <a href="javascript:void(0)"
                ><i class="mdi mdi-file-outline"></i> 问卷管理</a
              >
              <ul class="nav nav-subnav">
                <li><a href="../lms-teacher/create_questionnaire.html">发布问卷</a></li>
                <li><a href="../lms-teacher/questionnaire_list.html">问卷列表</a></li>
              </ul>
            </li>
            <li class="nav-item nav-item-has-subnav">
              <a href="javascript:void(0)"
                ><i class="mdi mdi-file-outline"></i> 论坛管理</a
              >
              <ul class="nav nav-subnav">
                <li><a href="../lms-teacher/create_forum.html">发布帖子</a></li>
                <li><a href="../lms-teacher/forum_list.html">帖子列表</a></li>
                <li><a href="../lms-teacher/forum_list_self.html">我的帖子</a></li>
              </ul>
            </li>
          </ul>
        </nav>
      </div>
    </aside>
    <!--End 左侧导航-->
    
    <!--头部信息-->
    <header class="lyear-layout-header">
      
      <nav class="navbar navbar-default">
        <div class="topbar">
          
          <div class="topbar-left">
            <div class="lyear-aside-toggler">
              <span class="lyear-toggler-bar"></span>
              <span class="lyear-toggler-bar"></span>
              <span class="lyear-toggler-bar"></span>
            </div>
            <span class="navbar-page-title"> 后台首页 </span>
          </div>
          
          <div class="topbar-right">
              <a href="javascript:void(0)" data-toggle="dropdown">
                <span>笔下光年 <span class="caret"></span></span>
              </a>
              <ul class="dropdown-menu dropdown-menu-right">
                <li> <a href="../lyear_pages_login.html"><i class="mdi mdi-logout-variant"></i> 退出登录</a> </li>
              </ul>
          </div>
          
        </div>
      </nav>
      
    </header>
    <!--End 头部信息-->
    
    <main class="lyear-layout-content">
      
        <div class="container-fluid">
          
          <div class="row">
            <div class="col-lg-12">
              <div class="card">
                <div class="card-body">
                  
                  <form action="#!"class="row">
                    <div class="form-group col-md-12">
                      <label for="title">作业名</label>
                      <input type="text" class="form-control" id="assignmentName" name="assignmentName" value="" placeholder="请输入作业名" />
                    </div>
                    <div class="form-group col-md-12">
                      <label for="content">作业内容</label>
                      <textarea class="form-control" id="content" name="content" rows="5" value="" placeholder="作业内容"></textarea>
                    </div>
                    <div class="col-md-12">
                      <button class="btn btn-primary" onclick="assignment()">确 定</button>
                    </div>
                  </form>
         
                </div>
              </div>
            </div>
            
          </div>
          
        </div>
        
      </main>
  </div>
</div>

<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="../js/main.min.js"></script>
<script type="text/javascript" src="../js/http.js"></script>

<script type="text/javascript">

function assignment() {
    var assignmentName = document.getElementById('assignmentName').value;
    var content = document.getElementById('content').value;

    console.log("作业名: " + assignmentName);
    console.log("作业内容: " + content);

    var reqData = {
    "assignmentName": assignmentName,
    "content": content,
    "type": 1
}
    var res = httpAddAssignment(reqData);
    if(res.success){
      alert('发布成功！');
    }else{
      alert('发布失败！');
    }

}


</script>
</body>
</html>